<?php
function site_url($uri = '')
	{
		if (is_array($uri))
		{
			$uri = implode('/', $uri);
		}

		if ($uri == '')
		{
			return $this->slash_item('base_url').$this->item('index_page');
		}
		else
		{
			$suffix = ($this->item('url_suffix') == FALSE) ? '' : $this->item('url_suffix');
			return $this->slash_item('base_url').$this->slash_item('index_page').preg_replace("|^/*(.+?)/*$|", "\\1", $uri).$suffix;
		}
	}
  function redirect($uri = '', $method = 'location')
{
	switch($method)
	{
		case 'refresh' : header("Refresh:0;url=".site_url($uri));
			break;
		default        : header("location:".site_url($uri));
			break;
	}
	exit;
}
?>
